<template>
    <div>
        <mt-button type="default" size="normal">default</mt-button>
        <mt-button type="danger" size="large" plain @click="show">danger</mt-button>
        <router-link to="/account" class="btn btn-primary">Account</router-link>
        <router-link to="/goodslist" class="btn btn-success">GoodsList</router-link>

        <router-view></router-view>
    </div>
</template>

<script>
import { Toast } from 'mint-ui';
export default {
    data() {
        return {
            toastInstance: null
        }
    },
    created() {
        this.getList();
    },
    methods: {
        getList(){
            this.show();
            setTimeout(()=>{
                this.toastInstance.close();
            },3000);
        },
        show() {
            this.toastInstance = Toast({
                message: 'hello world',
                position: 'top',
                duration: -1,
                iconClass: 'glyphicon glyphicon-ok',
                className: 'mytoast' // 自定义的Toast的样式，需要自己提供一个类名
            });
        }
    },
}
</script>

<style>

</style>